package com.zdj.presentation.modules.user.holders;

import android.databinding.ViewDataBinding;
import android.support.annotation.LayoutRes;
import android.view.ViewGroup;
import android.widget.TextView;

import com.easyrecyclerview.adapter.BaseViewHolder;
import com.zdj.presentation.R;
import com.zdj.presentation.databinding.RowUserBinding;
import com.zdj.presentation.modules.user.models.UserModel;

/**
 * Created by zdj on 16-5-29.
 */

public class UserViewHolder extends BaseViewHolder<UserModel,RowUserBinding> {

    /**
     * 不使用BaseViewHolder(ResId)是因为 Databinding 框架已经为layout生成了一个对应的ViewDatabinding对象 <br/>
     * 必须使用该对象传递值，而如果使用BaseViewHolder(ResId)，则系统会另外加载一次layout布局
     * 由{@link BaseViewHolder#BaseViewHolder(ViewGroup, int)} 可知 <br/>
     * 作者 ：zdj <br/>
     * created at 16-6-1 下午10:05
     */
    public UserViewHolder(RowUserBinding rowUserBinding) {
        super(rowUserBinding);
    }

    @Override
    public void setData(UserModel data) {
        super.setData(data);
        dataBinding.setUserModel(data);
    }
}
